<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    //首页
    public function index()
    {
        $id=session('user_id');
        $type=\DB::table('admin')->where(array('id'=>$id))->value('type');
        if ($type==1) {
            $label="超级管理员";
        }else{
            $label="普通管理员";
        }
        $username=\DB::table('admin')->where(array('id'=>$id))->value('name');
        return view('admin.index.index',compact('type','label','username'));
    }
    //我的桌面
    public function welcome()
    {
        $id=session('user_id');
        return view('admin.index.welcome');
    }
}